Use the new api to release resources
authorMatthias Clasen <mclasen@redhat.com>
Thu, 18 Jan 2018 01:19:19 +0000 (20:19 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 18 Jan 2018 01:19:19 +0000 (20:19 -0500)
When we unrealize a GL area with outstanding textures,
call gdk_texture_release_gl on them to avoid later crashes.

gtk/gtkglarea.c

index f6254cf8a4cefb5f1734891421fa325110905265..d7e727b23360309bd20d53890705fb7f29258d83 100644 (file)
@@ -385,11 +385,15 @@ delete_one_texture (gpointer data)
 {
   Texture *texture = data;
 
+  if (texture->holder)
+    gdk_texture_release_gl (texture->holder);
+
   if (texture->id != 0)
     {
       glDeleteTextures (1, &texture->id);
       texture->id = 0;
     }
+
   g_free (texture);
 }